package com.company;

public class Grade {
    public static void main(String[] args) {
        double points = 20;
        System.out.println(getGrade(points));

        printGradeTable();

        System.out.println(isPass(points));
    }

    static void printGradeTable() {
        System.out.println("grade points");
        System.out.println( 1.3 + "\t" + 0 + " - " + 49.5);
        for (int i = 0; i < 8; i++) {
            System.out.println( (1.7+0.3*i+i / 3*0.1) + "\t" + (60+5*i) + " - " + (64.5+5*i));
        }
        System.out.println( 4.7 + "\t" + 100 + " - " + 104.5);
        System.out.println( 5.0 + "\t" + 105 + " - " + 120);

    }

    static double getGrade(double points) {
        double grade = 1.7;
        if (points < 49.5)
            return 1.0;
        if (points > 50 && points < 59.5)
            return 1.3;
        if (points > 100 && points < 104.5)
            return 4.7;
        if (points > 105)
            return 5.0;
        int temp =  ((int)points - 60) / 5;
        int temp1 = temp / 3;
        grade += temp * 0.3 + temp1 * 0.1;
        return grade;
    }

    static boolean isPass(double points){
            return (getGrade(points) >2.0);
    }
}

